const Editor = require('../../../src/index');
const Util = Editor.Util;
const dom = document.createElement('div');
// const expect = require('chai').expect;
const data = require('../../../demos/data/sample.json');
document.body.appendChild(dom);

describe('contextmenu test', () => {
  const editor = new Editor();
  const dom = Util.createDOM(`
    <div>
      <div id="page"></div>
      <div id="contextmenu">
        <div data-status="node-selected" class="menu">
          <button data-command="copy" class="command">复制</button>
          <button data-command="delete" class="command">删除</button>
        </div>
        <div data-status="edge-selected" class="menu">
          <button data-command="delete" class="command">删除</button>
        </div>
        <div data-status="group-selected" class="menu">
          <button data-command="copy" class="command">复制</button>
          <button data-command="unGroup" class="command">解组</button>
          <button data-command="delete" class="command">删除</button>
        </div>
        <div data-status="canvas-selected" class="menu">
          <button data-command="undo" class="command">插销</button>
          <button data-command="redo" class="command">重做</button>
          <button data-command="pasteHere" class="command">粘贴</button>
        </div>
        <div data-status="multi-selected" class="menu">
          <button data-command="copy" class="command">复制</button>
          <button data-command="paste" class="command">粘贴</button>
          <button data-command="addGroup" class="command">归组</button>
        </div>
      </div>
    </div>
  `);
  document.body.appendChild(dom);
  const contextmenu = new Editor.Contextmenu({
    container: 'contextmenu',
    width: 120,
    height: 120
  });
  const page = new Editor.Flow({
    graph: {
      container: 'page',
      height: 500,
      width: 500
    }
  });
  page.read(data);
  editor.add(page);
  editor.add(contextmenu);
  it('init', () => {
    editor.destroy();
    dom.destroy();
  });
});
